package com.gp.dwt.utils;

/**
 * @author 小杜
 * @description: 邮箱正则验证工具
 */
public class EmailValidateUtil {
    public static boolean checkEmail(String email) {
        if (email == null || "".equals(email)) {
            return false;
        }
        String regularExpression = "^([a-z0-9A-Z]+[-|_.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
        try {
            return email.matches(regularExpression);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}
